home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Compilers / digital marsC compier / dm / include / Hugeptr.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-03-16  |  744 b   |  35 lines

  1. /* Copyright (C) 1986-2001 by Digital Mars. $Revision: 1.1.1.1 $ */
  2. #if __SC__ || __RCC__
  3. #pragma once
  4. #endif
  5.  
  6. #ifndef __HUGEPTR_H
  7. #define __HUGEPTR_H 1
  8.  
  9. #if __cplusplus
  10. extern "C" {
  11. #endif
  12.  
  13. #if __INTSIZE == 4
  14.  
  15. #define hugeptr_cmp(h1,h2) ((h1) - (h2))
  16. #define hugeptr_diff(h1,h2) ((h1) - (h2))
  17. #define hugeptr_add(h1,offset) ((h1) + (offset))
  18.  
  19. #else
  20.  
  21. long __pascal hugeptr_diff(void __far *h1,void __far *h2);
  22. void __far * __pascal hugeptr_add(void __far *h1,long offset);
  23.  
  24. #define hugeptr_cmp(h1,h2) ((long)(h1) - (long)(h2))
  25. #define hugeptr_diff(h1,h2) (hugeptr_diff((h1),(h2)) / sizeof(*h1))
  26. #define hugeptr_add(h,offset) (hugeptr_add(h,(long)offset * sizeof(*h)))
  27.  
  28. #endif
  29.  
  30. #if __cplusplus
  31. }
  32. #endif
  33.  
  34. #endif
  35.